<template>
  <div class="y-btnList">
    <p>y-btnList</p>
    <y-btnList @submit="submit" @update="update" :btnConfig="btnConfig" />
  </div>
</template>

<script>
import { Loading } from "element-ui";
export default {
  name: "cp1",
  data() {
    return {
      Loading,
      load: null,
      btnConfig: {
        list: [
          {
            label: "打开Loading",
            clickName: "submit",
          },
          {
            label: "普通按钮",
            clickName: "update",
            type: "primary",
          },
        ],
      },
    };
  },
  methods: {
    submit(model) {
      this.load = this.Loading.service({
        lock: true,
        text: "加载中...",
        spinner: "el-icon-loading",
        background: "rgba(0, 0, 0, 0.7)",
      });
      setTimeout(() => {
        this.load = this.Loading.service({
          lock: true,
          text: "测试...",
          spinner: "el-icon-loading",
          background: "rgba(0, 0, 0, 0.7)",
        });
      }, 3000);
    },
    update(model) {
      console.log(model);
    },
  },
};
</script>

<style lang="scss" scoped>
</style>